using System;
using System.Windows.Forms;

using FreeFlow.Administration;

namespace FreeFlowAdministrator
{
	/// <summary>
	/// Summary description for AuthenticationFailuresAdaptor.
	/// </summary>
	public class AuthenticationFailuresAdaptor : Adaptor, IRefreshable, IClearable
	{
    private DesignerLog log;
    public AuthenticationFailuresAdaptor(DesignerLog log)
    {
      this.log = log;
    }

    public override string Text
    {
      get
      {
        return "Authentication Failures (" + log.Count + ")";
      }
    }

    public override Control GetRenderer()
    {
      AuthenticationFailuresControl control = new AuthenticationFailuresControl();
      control.LoadDesignerLog(log);
      control.RefreshRequired += new EventHandler(TriggerRefreshRequired);
      return control;
    }

    public override object Object
    {
      get
      {
        return log;
      }
    }

    #region IRefreshable Members

    public void Refresh()
    {
      log.Refresh();
    }

    #endregion
    #region IClearable Members

    public void Clear()
    {
      log.Clear();
    }

    #endregion
	}
}
